<?php if (!defined('THINK_PATH')) exit();?><html>
    <head>
        <title>供应商新增</title>
        <link href="<?php echo (ADMIN_CSS_URL); ?>bootstrap.css" rel="stylesheet" />
        <link href="<?php echo (ADMIN_CSS_URL); ?>lz-style.css" rel="stylesheet" />
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.form.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>bootstrap.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>DatePicker/WdatePicker.js"></script>
        <script language="JavaScript">

            $(function () {
                $('#addform').ajaxForm({
                    beforeSubmit: checkForm, // pre-submit callback
                    success: complete, // post-submit callback
                    dataType: 'json'
                });
                function checkForm() {

                    if ('' == $.trim($('#VendorShortName').val())) {
                        $('#success').hide();
                        $('#error').html('[<?php echo (LB_VENDORSHORTNAME); ?>]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VendorFullName').val())) {
                        $('#success').hide();
                        $('#error').html('[<?php echo (LB_VENDORFULLNAME); ?>]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VendorAddress').val())) {
                        $('#success').hide();
                        $('#error').html('[<?php echo (LB_VENDORADDRESS); ?>]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VendorRespName').val())) {
                        $('#success').hide();
                        $('#error').html('[<?php echo (LB_VENDORRESPNAME); ?>]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VendorRespPhoneNo').val())) {
                        $('#success').hide();
                        $('#error').html('[<?php echo (LB_VENDORRESPPHONENO); ?>]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VendorRespMobilePhoneNo').val())) {
                        $('#success').hide();
                        $('#error').html('[<?php echo (LB_VENDORRESPMOBILEPHONENO); ?>]不能为空').show();
                        return false;
                    }

                    //可以在此添加其它判断
                }
                function complete(data) {
                    if (data.status === 1) {
                        $('#error').hide();
                        $('#success').html(data.info).show();
                    } else {
                        $('#success').hide();
                        $('#error').html(data.info).show();
                    }
                }

            });

        </script>

    </head>
    <body>
        <div class="container">
            <div class="row div_head" >
                <div class=" col-xs-6 col-sm-6 text-primary">
                    当前位置是：生产系统>供应商管理>供应商设置>供应商新增
                </div>
                <div class="col-xs-6 col-sm-3"></div>
                <div class="col-xs-6 col-sm-3">
                    <a style="text-decoration: none" href="/ecs/index.php/Admin/Vendor/lst">【返回】</a>
                </div>
            </div>

            <hr />
            <div class="row div_form" >
                <form id="addform" action="/ecs/index.php/Admin/Vendor/add" method="post">
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VendorShortName" class="control-label"><?php echo (LB_VENDORSHORTNAME); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VendorShortName" name="VendorShortName" class="form-control" placeholder="<?php echo (LB_VENDORSHORTNAME); ?>"   maxlength="42"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VendorFullName" class="control-label"><?php echo (LB_VENDORFULLNAME); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VendorFullName" name="VendorFullName" class="form-control" placeholder="<?php echo (LB_VENDORFULLNAME); ?>"   maxlength="42"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VendorAddress" class="control-label"><?php echo (LB_VENDORADDRESS); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VendorAddress" name="VendorAddress" class="form-control" placeholder="<?php echo (LB_VENDORADDRESS); ?>"   maxlength="200"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VendorRespName" class="control-label"><?php echo (LB_VENDORRESPNAME); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VendorRespName" name="VendorRespName" class="form-control" placeholder="<?php echo (LB_VENDORRESPNAME); ?>"   maxlength="50"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VendorRespPhoneNo" class="control-label"><?php echo (LB_VENDORRESPPHONENO); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VendorRespPhoneNo" name="VendorRespPhoneNo" class="form-control" placeholder="<?php echo (LB_VENDORRESPPHONENO); ?>"   maxlength="15"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VendorRespMobilePhoneNo" class="control-label"><?php echo (LB_VENDORRESPMOBILEPHONENO); ?>:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VendorRespMobilePhoneNo" name="VendorRespMobilePhoneNo" class="form-control" placeholder="<?php echo (LB_VENDORRESPMOBILEPHONENO); ?>"   maxlength="11"   required />
                    </div>

                    <div class="col-xs-6 col-sm-3">
                        <input type="submit" id="search"  class="btn btn-default" value="提交">
                        <input type="reset" class="btn btn-default" value="清 空">
                    </div>

                </form>
            </div>
            <div id="error" class="row text-danger"></div>
            <div id="success" class="row text-success"></div>

        </div>

    </body>
</html>